/**
 * 
 */
package qy.jalgotrade.broker.slippage;

import qy.jalgotrade.bar.Bar;
import qy.jalgotrade.broker.Order;

/**
 * <pre>
 * Base class for slippage models. 滑点模型 基类.
 * 
 * .. note::
 *     This is a base class and should not be used directly.
 * </pre>
 * 
 * @author c-geo
 *
 */
public abstract class SlippageModel {

	/**
	 * 
	 */
	public SlippageModel() {

	}

	/**
	 * Returns the slipped price per share for an order.
	 * 
	 * @param order      The order being filled.
	 * @param price      The price for each share before slippage.
	 * @param quantity   The amount of shares that will get filled at this time for this order.
	 * @param bar        The current bar.
	 * @param volumeUsed The volume size that was taken so far from the current bar.
	 * @return
	 */
	public abstract double calculatePrice(Order order, double price, double quantity, Bar bar, double volumeUsed);
}
